package day19.Exer;

/**
 *  *  product为商品信息节点，discount表示是否折扣，如果是折扣商品，打七折；
 *  *   factoryaddr是工厂地址；
 *  *  itemno为商品编号，name为商品名称，price为商品单价，unit是计价单位，stockcount是库存量。
 */
public class Products {
    private int itemno;
    private String name;
    private double price;
    private String unit;
    private int stockcount;
    private String factoryaddr;
    private boolean discount;
    public Products() {
    }

    public Products(int itemno, String name, double price, String unit, int stockcount, String factoryaddr, boolean discount) {
        this.itemno = itemno;
        this.name = name;
        this.price = price;
        this.unit = unit;
        this.stockcount = stockcount;
        this.factoryaddr = factoryaddr;
        this.discount = discount;
    }

    public int getItemno() {
        return itemno;
    }

    public void setItemno(int itemno) {
        this.itemno = itemno;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public int getStockcount() {
        return stockcount;
    }

    public void setStockcount(int stockcount) {
        this.stockcount = stockcount;
    }

    public String getFactoryaddr() {
        return factoryaddr;
    }

    public void setFactoryaddr(String factoryaddr) {
        this.factoryaddr = factoryaddr;
    }

    public boolean isDiscount() {
        return discount;
    }

    public void setDiscount(boolean discount) {
        this.discount = discount;
    }

    @Override
    public String toString() {
        return "产品信息{" +
                "编号=" + itemno +
                ", 名称='" + name + '\'' +
                ", 单价=" + price +
                "元, 库存=" + stockcount+ unit + '\''  +
                ", 产地='" + factoryaddr + '\'' +
                ", 是否折扣=" + discount +
                '}';
    }
}
